<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./jquery.js"></script>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      li {
        list-style: none;
        width: 100px;
        height: 50px;
        float: left;
        background: red;
        margin-left: 2px;
      }
      .div1 {
        clear: both;
        width: 304px;
        height: 200px;
        border: 1px solid #ccc;
        background: gold;
        display: none;
      }
    </style>
  </head>
  <body>
    <div>
      <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
      </ul>
      <div class="div1">111111</div>
      <div class="div1">22222222222</div>
      <div class="div1">333333333333</div>
    </div>
  </body>
  <script>
    $(function () {
      //默认第一个显示
      $('.div1:first').show()
      //给li注册鼠标滑过事件
      $('li').hover(function () {
        //获取到当前第几个li
        var index = $(this).index()
        //先把所有的div隐藏
        $('.div1').hide()
        //在显示对应下标的div
        $('.div1:eq(' + index + ')')
          .stop()
          .slideDown()
      })
    })
  </script>
</html>
